home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Dev / misc / iff-rgfx.lha / IFF-RGFX / RGFX-Chunks.txt next >
Text File  |  2004-08-29  |  5KB  |  130 lines

  1.  
  2.  $VER: RGFX-Chunks.doc 2.0 (28.8.2004)
  3.  =====================================
  4.  
  5.  A typical structure of a RGFX file (recommended) :
  6.  
  7.  
  8.      FORM-RGFX
  9.  
  10.        RGHD     Image Header
  11.        RSCM     Screenmode information
  12.        RCOL     Color and transparency information
  13.        RBOD     The Graphics itself
  14.  
  15.  
  16.   Additional (optional) chunks should appear somewhere
  17.   between RCOL and RBOD.
  18.  
  19.   Please refer to rgfx.h for the chunk specifications
  20.   and allowed standard chunks.
  21.  
  22.   A few optional third party chunks are discussed
  23.   in the following. These are not part of the
  24.   format specification and should be considered
  25.   private, proprietary extensions.
  26.  
  27.  
  28.  RGFX - Optional chunks
  29.  ----------------------
  30.  
  31.    RXYA - Viewable XY-Area
  32.    -----------------------
  33.    ** based on an idea by Peter Bornhall <bornhall@swipnet.se>
  34.  
  35.       It may be useful to specify a small "view area" fromout
  36.       a larger image, e.g. a 320x200 area inside a 2048x2048
  37.       image.
  38.  
  39. struct RXYA
  40. {
  41.  ULONG xy_LeftEdge;
  42.  ULONG xy_TopEdge;
  43.  ULONG xy_Width;
  44.  ULONG xy_Height;
  45. };
  46.  
  47.  
  48.    RXXX - Image Rating
  49.    -------------------
  50.    ** based on an idea by Peter Bornhall <bornhall@swipnet.se>
  51.  
  52.       Not all images may be suitable for any group of recepients.
  53.  
  54. struct RXXX
  55. {
  56.  ULONG xxx_Rating; /* e.g. for parents who want to control access */
  57. };
  58.  
  59. #define RXXX_HARMLESS          (0L) /* this image won't affect anyone        (e.g. cliparts)       */
  60. #define RXXX_PARENTAL_ADVISORY (1L) /* some people may feel offended by this (e.g. violent comics) */
  61. #define RXXX_OFFENSIVE         (2L) /* most people will feel offended by this (whatever)           */
  62.  
  63.  
  64.    RALH - Alpha Channel Header (not with RGBA formats)
  65.    ---------------------------------------------------
  66.    ** based on an idea by Marcel Offermans <M.Offermans@CBi.CentraalBeheer.NL>
  67.    ** not recommended for new implementations based on RGFX V2.0 or higher 
  68.  
  69.       We support three different types of (late-added or separate) Alpha channels:
  70.  
  71.         - operating on a colormap (with upto 8 bit images only, and
  72.           only, if MORE than one color should be transparent, i.e.
  73.           when RCOL.rcol_TransColor does not suffice). Like with RCOL,
  74.           the supplied table should be sized for 256 colors always, thus
  75.           any unused entries should be set to zero (= fully transparent).
  76.  
  77.         - operating on separate pixels (with any bitdepth),
  78.           supplying a width*height area of 0..255 values for
  79.           each pixel (or component), where 0 means "fully transparent"
  80.           and 255 means "not transparent at all"
  81.  
  82.           NOTE: this is the opposite as in PNG or in the ARGB formats (akl, 28.08.04)
  83.  
  84.       We also allow to differ between "complete" transparency and
  85.       "color component specific" transparency, i.e. you either may apply
  86.       the transparency to the whole RGB value of the color/pixel OR to each one
  87.       of the RGB color components separately (which means 3 times as much data).
  88.       This works with colormaps as well as pixelmaps.
  89.  
  90.       Examples:   - transparent colormap, for whole color
  91.  
  92.                       256 entries, each one ranged 0..255
  93.                       [ size: 256 bytes ]
  94.  
  95.                   - transparent colormap, for color components
  96.  
  97.                       256 triple entries, means
  98.                       three sub entries ranged 0..255 (for R, G and B)
  99.                       [ size: 768 bytes ]
  100.  
  101.                   - transparent pixelmap, for whole 8/24 Bit pixels
  102.  
  103.                       <width> x <height> entries, each one
  104.                       ranged 0..255
  105.                       [ size: width x height ]
  106.  
  107.                   - transparent pixelmap, for RGB components 8/24 Bit pixels
  108.  
  109.                       <width> x <height> entries, means each pixel with
  110.                       three sub entries ranged 0..255 (for R, G and B)
  111.                       [ size: width x height x 3 ]
  112.  
  113.                       This may not be practical for most uses, since it
  114.                       will double the space needed for a 24 bit graphics
  115.                       and will need four times the space for a 8 bit graphics.
  116.  
  117.  
  118. struct RALH
  119. {
  120.  ULONG ralh_AlphaType;            /* the type of alpha channel - colormap (8 bit)    */
  121.                                   /* or pixelmap (8/24 bit)                          */
  122.  ULONG ralh_TransparencyType;     /* Completely or for a single component, only ?    */
  123. };
  124.  
  125. #define RALH_TYPE_PIXEL (0L)      /* 8/24 bit: (non)transparacy value for each pixel */
  126. #define RALH_TYPE_CMAP  (1L)      /* upto 8 Bit, only: supplies another colormap     */
  127.  
  128. #define RALH_TRANS_ALL       (0L) /* one 0.255 value for all components              */
  129. #define RALH_TRANS_COMPONENT (1L) /* one 0.255 value for each, separate component    */
  130.